<?php

class DoiNguBsController extends FController {

    public function actionIndex() {
        $model = new FNews();
        $data = $model->getTop(12, 1);
        
        $this->render('detail', array(
            'data' => $data['0'],
        ));
    }
    
    public function actionDetail($page = '') {
        $model = new FNews();
        $data  = $model->getDetail($page);

        if ($data) {
            $this->render('detail', array(
                'model' => $model,
                'data' => $data,
            ));
        } else {
            throw new CHttpException('403', 'Trang không tồn tại.');
        }
    }
    
}